"use strict";
/**
 * @author wangchenzhao
 * @date 2018/11/20
 */
module.exports = appInfo => {
    return {
        keys: 'my-cookie-secret-key',
        security: {
            csrf: false,
            ignoreJSON: true,
        },
        domainWhiteList: [
            'http://localhost:9000',
            'http://localhost:7000',
            'http://localhost:3000',
            'http://m.tl100.com',
            'https://m.tl100.com'
        ],
        cors: {
            origin: '*',
            allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
        },
        public_dir: appInfo.baseDir + '/app/public',
        // middleware: [ 'errorHandler' ],
        // 添加 view 配置
        view: {
            defaultViewEngine: '.ejs',
            mapping: {
                '.html': 'ejs',
                // '.tpl': '.ejs',
                // '.js': 'assets',
                // '.css': 'assets',
            },
        }
        // view: {
        //     mapping: {
        //       '.html': 'nunjucks',
        //     },
        // }
    }
}